# import random
#
# player=input('请输入：剪刀(0)  石头(1)  布(2)\n')
# player=int(player)
# computer=random.randint(0,2)
# print("计算机：",computer)
# if(((player==0)and(computer==2))or ((player==1))
#     and(computer==0)) or ((player==2) and (computer==1)):
#     print("恭喜，你赢了！")
# elif player==computer:
#     print("平局，要不再来一局！")
# else:
#     print("Game over！")
from tkinter import XView

# n=int(input("\nhow many numbers?\n"))
# sum=0.0
# for i in range(n):
#     x=float(input("enter a number>>"))
#     sum=float(sum+x)
# print("\nThe average is",sum/n)


# import string
# s=input("input a string:\n")
# letters=0
# space=0
# digit=0
# others=0
# for c in s:
#     if c.isalpha():
#         letters+=1
#     elif c.isspace():
#         space+=1
#     elif c.isdigit():
#         digit+=1
#     else:
#         others+=1
# print("letters=%d,space=%d,digit=%d,others=%d"%(letters,space,digit,others))


# import random
# for i in range(10):
#     for j in range(1,i+1):
#         print("%d*%d=%d"%(i,j,i*j),end=' ')
#     print("")


# i=0
# sum=0
# while i<=10:
#     sum=sum+i
#     i=i+1
# print(sum/11)

# for n in range(100,1000):
#     i=n//100
#     j=n//10%10
#     k=n%10
#     if n==i**3+j**3+k**3:
#         print(n)



# from random import randint
# x=randint(0,100)
# go='y'
# while go=='y':
#     print("Please input a number between 0-100:")
#     digit=int(input())
#     if digit==x:
#         print("猜对了！！")
#         break
#     elif digit>x:
#         print("猜大了！！")
#     else:
#         print("猜小了！！")
#     print("Do you want to continue? Input 'n' or 'y'")
#     go=input()
# else:
#     print("goodbye!!")


# def demo(v):
#     capital = little = digit = other =0
#     for i in v:
#         if 'A'<=i<='Z':
#             capital+=1
#         elif 'a'<=i<='z':
#             little+=1
#         elif '0'<=i<='9':
#             digit+=1
#         else:
#             other+=1
#     return (capital,little,digit,other)
#
#
# x = 'capital = little = digit = other =0'
# print(demo(x))


# radius=float(input("please input a num:"))
# s=(lambda r:3.1415926*r*r)(radius)
# print(s)
# print(round(s,3))#保留三位小数

# def fib(n):
#     a=1
#     b=1
#     c=0
#     if n==1 or n==2:
#         return 1
#     else:
#         for i in range(3,n+1):
#             c=a+b
#             a=b
#             b=c
#         return c
#
# num=int(input("请输入："))
# print("fib(%d):"%num,fib(num))


# def fact(n):
#     if n==1:
#         value=1
#     else:
#         value=n*fact(n-1)
#     return value
#
# n=int(input("Calculate n! Enter n="))
# print(n,"!=",fact(n))



# def bubble(List):
#     for i in range(0,len(List)-1):
#         for j in range(len(List)-1,i,-1):
#             if List[j-1]>List[j]:
#                 List[j-1],List[j]=List[j],List[j-1]
#     return List
# L1=[]
# num_str=input('请输入一个需排序的整数：')
# while len(num_str) != 0:
#     L1.append(int(num_str))
#     num_str=input('请输入一个需排序的整数：')
# print('排序后结果:', bubble(L1))

# def func():
#     p[0]=3  #列表可被修改，将列表第一个元素修改为3
# p=[5]  #定义列表
# func()
# print(p)


# v=3
# def func(p=v):
#     print(p)
# v=5
# func()

# def func(p=[]):
#     p.append(3)
#     return p
# func()
# func()
# print(func())

# def func():
#     p = []
#     p.append(3)
#     return p
# func()
# func()
# print(func())

# from operator import eq
# s1='Python'
# s2='python'
# print (sum(map(eq, s1, s2)))

# def func (a, n) :
#     result,each = a,a
#     for _ in range (n-1) :
#         each = each*10+a
#         result = result + each
#     return result
# print (func (2, 3))


# def func():
#     for i in range (10):
#         if i>3:
#             return i
#         yield i
# r=func()
# #print(next(r),next(r))
# print(*r)



# def is_prime(n):
#     """
#     判断一个整数是否为素数
#     :param n: 整数
#     :return: 如果是素数返回 True，否则返回 False
#     """
#     if n <= 1:
#         return False  # 1 和小于 1 的数不是素数
#     for i in range(2, n):  # 遍历从 2 到 sqrt(n)
#         if n % i == 0:  # 如果 n 能被 i 整除，说明不是素数
#             return False
#     return True  # 如果循环结束没有找到因数，说明是素数
#
#
# # 主程序
# if __name__ == "__main__":
#     number = int(input("请输入一个整数: "))
#     if is_prime(number):
#         print(f"{number} 是素数！")
#     else:
#         print(f"{number} 不是素数！")

# def count_characters(s):
#     """
#     统计字符串中大写字母、小写字母、数字、其他字符的个数
#     :param s: 输入字符串
#     :return: 元组 (大写字母个数, 小写字母个数, 数字个数, 其他字符个数)
#     """
#     upper = 0  # 大写字母计数
#     lower_count = 0  # 小写字母计数
#     digit_count = 0  # 数字计数
#     other_count = 0  # 其他字符计数
#
#     for char in s:  # 遍历字符串中的每个字符
#         if char.isupper():
#             upper+= 1  # 大写字母
#         elif char.islower():
#             lower_count += 1  # 小写字母
#         elif char.isdigit():
#             digit_count += 1  # 数字
#         else:
#             other_count += 1  # 其他字符
#
#     return (upper_count, lower_count, digit_count, other_count)  # 返回结果元组
#
#
# # 主程序
# if __name__ == "__main__":
#     input_str = input("请输入一个字符串: ")
#     result = count_characters(input_str)
#     print(f"大写字母: {result[0]}，小写字母: {result[1]}，数字: {result[2]}，其他字符: {result[3]}")


# def max_and_sum(*args):
#     """
#     接收任意多个整数，返回最大值和总和
#     :param args: 任意多个整数
#     :return: 元组 (最大值, 总和)
#     """
#     if not args:  # 检查是否提供了参数
#         return None, 0  # 如果没有参数，返回 (None, 0)
#
#     max_value = max(args)  # 计算最大值
#     total_sum = sum(args)  # 计算总和
#
#     return max_value, total_sum  # 返回最大值和总和的元组
#
#
# # 主程序
# if __name__ == "__main__":
#     numbers = input("请输入任意多个整数（用空格分隔）: ")
#     numbers = eval(numbers)  # 将输入的字符串转为整数列表
#     result = max_and_sum(*numbers)
#     print(f"最大值: {result[0]}，总和: {result[1]}")


# a=3
# print(a*2)
# print(a**a)
#
# b="abcjd"
# print(b*2)

# a=3.1415926535
# print("%5.2f"%a)
# print("%-5.2f"%a)
# s="abcdefghijk"
# print(s)

# w=65
# h=1.789
# print("weight{1:3d}kg,height {0:.2f} meters.".format(h,w))

# p=list(filter(None,[0,1,2,3,0,0]))
# print(range(10,20)[4])


# s = ' aaaaasdf '
# result = s.strip('af ')
# print(result)  # 输出：'sd'
#
# a=[i for i,v in enumerate([3,5,7,3,7]) if v==max([3,5,7,3,7])]
# print(a)
# print(type(a))

# def demo(m,n):
#     p=m*n
#     if m<n:
#         m,n=n,m
#     while m%n!=0:
#         m,n=n,m%n
#     return (n,p//n)
#
# print(demo(18,3))


# def convert （x）：
# # 考虑小数的情况
# temp = stzNunber.split（'.'，1）# 整数部分
# first = temp [0]
# if not first. isdigit() :
# return
# '不是有效数字’
# # 小数部分
# try:
# second = temp [1]
# if not second. isdigit) :
# return’不是有效数字”
# except:
# second = »›
# # 增加千分位逗号
# def nested(s) :
# result = 0)
# length = len (s)index = length % 3
# if index != 0:
# result. append (s [:index))
# for i in range (index,
# result. append (s [i :i+3])
# length,3）：
# return''- join(result)
# first = nested（first）
# # 小数部分和整数部分的千分位不一样if second：
# second = ''. join (reversed (second))
# second = nested (second)
# second = ''
# • join (reversed (second) )
# # 删除两侧可能的0和干分位逗号
# Teturn'.'.join（lfirst，＃ 删除整数左侧可能的0和逗号
# second]). strip(',0')
# I
# return first. lstrip('0,')
#
# while True：
# 2mput（输入不带千分位逗号的数字：”）
# ix='0：
# print（bye'）
# #料##社##ERROR###H##
# print ()
# print (convert (z) )


#
# s:int=[3]
# print(s)

# print(list(enumerate({'a':97,'b':98,'c':99}.items())))
#
# import math

# x='[1,2,3,4]'
# print(list(x))


# def func():
#     global x
# func()
# print(x)
